import Vue from 'vue'
import VueRouter from 'vue-router'
import FoodView from '../views/FoodView.vue'
import FoodDetail from '../views/FoodDetail.vue'
import NoteDetail from '../views/NoteDetail.vue'
import UploadNoteView from '../views/UploadNoteView.vue'
import RegisterView from '../views/RegisterView.vue'
import FoodForm from '../views/FoodForm.vue'
import CollectView from '../views/CollectView.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'food',
    component: FoodView
  },
  {
    path: '/food',
    name: 'fooddetail',
    component: FoodDetail
  },
  {
    path: '/foodform',
    name: 'foodform',
    component: FoodForm
  },
  {
    path: '/note',
    name: 'notedetail',
    component: NoteDetail
  },
  {
    path: '/upload',
    name: 'noteupload',
    component: UploadNoteView
  },
  {
    path: '/register',
    name: 'register',
    component: RegisterView
  },
  {
    path: '/collect',
    name: 'collect',
    component: CollectView
  },
  {
    path: '/share',
    name: 'share',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/ShareView.vue')
  },
  {
    path: '/login',
    name: 'login',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/LoginView.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
